package com.gzgy.ustore.api.common.util;

import java.util.Date;
import java.util.UUID;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * @author kelvin.tie
 */
@Component
@Scope("singleton")
public class Constant {


    public static Long accessId;

    public static String secretKey;

    public static String apkLink;

    @Value("${access.id}")
    public void setAccessId(Long accessId) {
        Constant.accessId = accessId;
    }

    @Value("${secret.key}")
    public void setSecretKey(String secretKey) {
        Constant.secretKey = secretKey;
    }

    @Value("${apk.link}")
    public void setApkLink(String apkLink) {
        Constant.apkLink = apkLink;
    }

    public static String getAppPath(String path){
        if(StringUtils.isEmpty(path)){
            return "";
        }else{
            return apkLink+path;
        }
    }

    public static String getUUID() {
        String pkId = UUID.randomUUID().toString().replace("-", "");
        return pkId;
    }

}
